package com.meichis.yndms.model;

import android.text.TextUtils;

import com.meichis.mcsappframework.entity.Attachment;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author xmy
 * @title
 * @remake
 * @create 2021-03-18 15:30
 */
public class InspectResult implements Serializable {


    ///<summary>
    ///ID
    ///</summary>
    private int ID = 0;

    ///<summary>
    ///门店ID
    ///</summary>
    private int Client = 0;
    private String ClientName = "";

    /// <summary>
    /// 关联导购
    /// </summary>
    private int Promotor = 0;
    private String PromotorName = "";

    ///<summary>
    ///巡查模板
    ///</summary>
    private int InspectTemplate = 0;
    private String InspectTemplateName;

    /// <summary>
    /// 二维键关联模式 1.字典表 2.产品表 3.数据表
    /// </summary>
    private int Dim2KeyMode = 0;

    ///<summary>
    ///关联拜访表明细
    ///</summary>
    private int VisitJob = 0;

    /// <summary>
    /// 关联拜访模板
    /// </summary>
    private int VisitTemplate = 0;
    private String VisitTemplateName = "";

    /// <summary>
    /// 关联巡查任务
    /// </summary>
    private int InspectTask = 0;
    private String InspectTaskName = "";

    ///<summary>
    ///巡查通报角色
    ///</summary>
    private String NoticeRole = "";

    ///<summary>
    ///巡查问题描述
    ///</summary>
    private String InspectText = "";

    ///<summary>
    ///预期改进日期
    ///</summary>
    private String PreImproveDate = "1900-01-01";

    ///<summary>
    ///状态
    ///</summary>
    private int State = 0;
    private String StateName = "";

    ///<summary>
    ///改进结果描述
    ///</summary>
    private String ImproveText = "";

    ///<summary>
    ///实际改进日期
    ///</summary>
    private String ActImproveDate = "1900-01-01";

    ///<summary>
    ///改进确认人
    ///</summary>
    private int ActImproveStaff = 0;
    private String ActImproveStaffName = "";

    /// <summary>
    /// 总得分
    /// </summary>
    private double TotalScore = 0;

    /// <summary>
    /// 照片列表,多个照片间以|号间隔
    /// </summary>
    private String PhotosGUID = "00000000-0000-0000-0000-000000000000";

    ///<summary>
    ///经度
    ///</summary>
    private double Longitude = 0;

    ///<summary>
    ///纬度
    ///</summary>
    private double Latitude = 0;

    ///<summary>
    ///备注
    ///</summary>
    private String Remark = "";

    ///<summary>
    ///录入时间
    ///</summary>
    private String InsertTime = "1900-01-01";

    ///<summary>
    ///录入人
    ///</summary>
    private int InsertStaff = 0;
    private String InsertStaffName = "";


    //排班id
    private int InspectSchedule;

    //活动形式
    private int Classify;
    private String ClassifyName = "";

    /// <summary>
    /// 巡查明细
    /// </summary>
    private List<InspectResult_Detail> Items = new ArrayList<>();

    /// <summary>
    /// 问题列表
    /// </summary>
    private List<InspectResult_Issue> Issues = new ArrayList<>();

    /// <summary>
    /// 附件图片
    /// </summary>
    private List<Attachment> Atts = new ArrayList<>();

    /// <summary>
    /// 仓库
    /// </summary>
    private int WareHouse = 0;
    private String WareHouseName = "";

    /// <summary>
    /// 偏移量
    /// </summary>
    private int GeoOffset = 0;

    public int getInspectSchedule() {
        return InspectSchedule;
    }

    public void setInspectSchedule(int inspectSchedule) {
        InspectSchedule = inspectSchedule;
    }

    public int getClassify() {
        return Classify;
    }

    public void setClassify(int classify) {
        Classify = classify;
    }

    public String getClassifyName() {
        return ClassifyName;
    }

    public void setClassifyName(String classifyName) {
        ClassifyName = classifyName;
    }

    public int getID() {
        return ID;
    }

    public void setID(int ID) {
        this.ID = ID;
    }

    public int getClient() {
        return Client;
    }

    public void setClient(int client) {
        Client = client;
    }

    public String getClientName() {
        return ClientName;
    }

    public void setClientName(String clientName) {
        ClientName = clientName;
    }

    public int getPromotor() {
        return Promotor;
    }

    public void setPromotor(int promotor) {
        Promotor = promotor;
    }

    public String getPromotorName() {
        return PromotorName;
    }

    public void setPromotorName(String promotorName) {
        PromotorName = promotorName;
    }

    public int getInspectTemplate() {
        return InspectTemplate;
    }

    public void setInspectTemplate(int inspectTemplate) {
        InspectTemplate = inspectTemplate;
    }

    public String getInspectTemplateName() {
        return InspectTemplateName;
    }

    public void setInspectTemplateName(String inspectTemplateName) {
        InspectTemplateName = inspectTemplateName;
    }

    public int getDim2KeyMode() {
        return Dim2KeyMode;
    }

    public void setDim2KeyMode(int dim2KeyMode) {
        Dim2KeyMode = dim2KeyMode;
    }

    public int getVisitJob() {
        return VisitJob;
    }

    public void setVisitJob(int visitJob) {
        VisitJob = visitJob;
    }

    public int getVisitTemplate() {
        return VisitTemplate;
    }

    public void setVisitTemplate(int visitTemplate) {
        VisitTemplate = visitTemplate;
    }

    public String getVisitTemplateName() {
        return VisitTemplateName;
    }

    public void setVisitTemplateName(String visitTemplateName) {
        VisitTemplateName = visitTemplateName;
    }

    public int getInspectTask() {
        return InspectTask;
    }

    public void setInspectTask(int inspectTask) {
        InspectTask = inspectTask;
    }

    public String getInspectTaskName() {
        return InspectTaskName;
    }

    public void setInspectTaskName(String inspectTaskName) {
        InspectTaskName = inspectTaskName;
    }

    public String getNoticeRole() {
        return NoticeRole;
    }

    public void setNoticeRole(String noticeRole) {
        NoticeRole = noticeRole;
    }

    public String getInspectText() {
        return InspectText;
    }

    public void setInspectText(String inspectText) {
        InspectText = inspectText;
    }

    public String getPreImproveDate() {
        return PreImproveDate;
    }

    public void setPreImproveDate(String preImproveDate) {
        PreImproveDate = preImproveDate;
    }

    public int getState() {
        return State;
    }

    public void setState(int state) {
        State = state;
    }

    public String getStateName() {
        return StateName;
    }

    public void setStateName(String stateName) {
        StateName = stateName;
    }

    public String getImproveText() {
        return ImproveText;
    }

    public void setImproveText(String improveText) {
        ImproveText = improveText;
    }

    public String getActImproveDate() {
        return ActImproveDate;
    }

    public void setActImproveDate(String actImproveDate) {
        ActImproveDate = actImproveDate;
    }

    public int getActImproveStaff() {
        return ActImproveStaff;
    }

    public void setActImproveStaff(int actImproveStaff) {
        ActImproveStaff = actImproveStaff;
    }

    public String getActImproveStaffName() {
        return ActImproveStaffName;
    }

    public void setActImproveStaffName(String actImproveStaffName) {
        ActImproveStaffName = actImproveStaffName;
    }

    public double getTotalScore() {
        return TotalScore;
    }

    public void setTotalScore(double totalScore) {
        TotalScore = totalScore;
    }

    public String getPhotosGUID() {
        return PhotosGUID;
    }

    public void setPhotosGUID(String photosGUID) {
        PhotosGUID = photosGUID;
    }

    public double getLongitude() {
        return Longitude;
    }

    public void setLongitude(double longitude) {
        Longitude = longitude;
    }

    public double getLatitude() {
        return Latitude;
    }

    public void setLatitude(double latitude) {
        Latitude = latitude;
    }

    public String getRemark() {
        return Remark;
    }

    public void setRemark(String remark) {
        Remark = remark;
    }

    public String getInsertTime() {
        return InsertTime;
    }

    public void setInsertTime(String insertTime) {
        InsertTime = insertTime;
    }

    public int getInsertStaff() {
        return InsertStaff;
    }

    public void setInsertStaff(int insertStaff) {
        InsertStaff = insertStaff;
    }

    public String getInsertStaffName() {
        return InsertStaffName;
    }

    public void setInsertStaffName(String insertStaffName) {
        InsertStaffName = insertStaffName;
    }

    public List<InspectResult_Detail> getItems() {
        return Items;
    }

    public void setItems(List<InspectResult_Detail> items) {
        Items = items;
    }

    public List<InspectResult_Issue> getIssues() {
        return Issues;
    }

    public void setIssues(List<InspectResult_Issue> issues) {
        Issues = issues;
    }

    public List<Attachment> getAtts() {
        return Atts;
    }

    public void setAtts(List<Attachment> atts) {
        Atts = atts;
    }

    public int getWareHouse() {
        return WareHouse;
    }

    public void setWareHouse(int wareHouse) {
        WareHouse = wareHouse;
    }

    public String getWareHouseName() {
        return WareHouseName;
    }

    public void setWareHouseName(String wareHouseName) {
        WareHouseName = wareHouseName;
    }

    public int getGeoOffset() {
        return GeoOffset;
    }

    public void setGeoOffset(int geoOffset) {
        GeoOffset = geoOffset;
    }


    public boolean isFillComplete() {
        int count = Items.size();
        for (InspectResult_Detail detail : Items) {
            if (detail.getIsMustFill() == 1) {
                if (TextUtils.isEmpty(detail.getFillValue()) || TextUtils.isEmpty(detail.getFillName())) {
                    return false;
                }
            } else {
                if (TextUtils.isEmpty(detail.getFillValue()) || TextUtils.isEmpty(detail.getFillName())) {
                    count--;
                }
            }
        }
        //count ==0说明填写全部为非必填且都没填写内容
        return count != 0;
    }

}
